<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件委托</title>
</head>
<body>
    <ul id="list">
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ul>
    <script>
        const lis = document.querySelectorAll('#list li');
        console.log(lis);
        // for(let i=0;i<lis.length;i++){
        //     lis[i].addEventListener('click',function(){
        //         console.log(this.innerHTML );
        //     });
        // }
        document.getElementById('list').addEventListener('click',function(){
            // li 任何一个都会触发
            console.log('///');
            console.log(event.target.innerHTML);
        })
    </script>
</body>
</html>